home *** CD-ROM | disk | FTP | other *** search
/ Experimental BBS Explossion 3 / Experimental BBS Explossion III.iso / vbasic / dfvb18.zip / PBC-SUBS.DOC < prev   
Text File  |  1993-07-19  |  38KB  |  1,155 lines

  1.  
  2.  The following routines are available for your use. DoorFrame itself does not
  3. use most of the routines so you may retain or delete them from DFRAMEX.LIB as
  4. you see fit (the ones DoorFrame uses are noted - DON'T DELETE THEM!). The
  5. library is modularized so if you don't CALL a routine in your code, it will
  6. not be included in the final .EXE file. Since these routines come from the
  7. PBClone library by Tom Hanlin, I have taken the liberty of including his
  8. descriptions of the routines.
  9.  
  10. Name  : BigPrint             (Called by DoorFrame - DON'T DELETE!)
  11. Class : Display
  12. Level : BIOS
  13.  
  14. As the name suggests, this routine displays text in large
  15. characters.  How large?  Eight times as high and as wide as
  16. normal!  Each "big character" will be composed of many
  17. normal-sized characters.  You may choose the normal character
  18. used to create the big characters (the default is a CHR$(219)
  19. solid block character, if you pass a null string here).
  20.  
  21. You should avoid using CHR$(128) to CHR$(255) when in either of
  22. the CGA graphics modes, as many CGAs are unable to display
  23. these characters when in graphics mode.
  24.  
  25.    BigPrint St$, FormCh$, Row%, Column%, Attr%
  26.  
  27. St$       string to display in big characters
  28. FormCh$   character used to compose the big characters
  29. Row%      starting row
  30. Column%   starting column
  31. Attr%     color/attribute of big characters (see CalcAttr)
  32.           NOTE: This is a local only procedure. It will NOT be sent to the
  33.                 remote computer!
  34.  
  35.  
  36. Name  : CalcAttr                (Called by DoorFrame - DON'T DELETE!)
  37. Class : Display
  38. Level : Any
  39.  
  40. An attribute is a combination of the foreground and background colors in a 
  41. format which is used by all types of displays when in text mode. 
  42.  
  43. Foreground colors are usually specified as 0-15, with backgrounds as 0-7.
  44.  
  45.    CalcAttr Foreground%, Background%, Attr%
  46.  
  47. Foreground%  foreground color
  48. Background%  background color
  49. -------
  50. Attr%        color "attribute"
  51.  
  52.  
  53. Name  : CalcDate             (Calculate Date)
  54. Class : Time
  55. Level : Any
  56.  
  57. This routine calculates what the date will be a given number of
  58. days from now, either in the past or the future.  Actually, you
  59. may use any starting date, not just the current date.  An error
  60. code is returned if the starting date or resulting date are not
  61. valid.  Dates may not preceed January 1, 1900.
  62.  
  63. CalcDate accepts the date in any standard form ("01/30/91" or
  64. "01-30-1991", for example) and returns its results in the same
  65. format.
  66.  
  67.    CalcDate StartDate$, Days&, Direction%, NewDate$, ErrCode%
  68.  
  69. StartDate$   starting date
  70. Days&        number of days from the current date (0 or more)
  71. Direction%   return future result (0) or past (nonzero)
  72. -------
  73. NewDate$     resulting date
  74. ErrCode%     whether the dates are valid (0 yes)
  75.  
  76.  
  77. Name  : CDROM
  78. Class : Disk / Equipment
  79. Level : DOS
  80.  
  81. This routine tells you whether the Microsoft CD-ROM Extensions are installed.
  82. If so, it tells you what the letter of the first CD-ROM logical drive is and
  83. how many logical drives exist.
  84.  
  85. Note: The CD-ROM installation check conflicts with the GRAPHICS.COM
  86. installation check for DOS 4.0, due to some screw-up at IBM or Microsoft.
  87. This may cause unexpected results.  I'm not yet sure whether DOS 5.0 is
  88. similarly afflicted.
  89.  
  90.    FirstDrive$ = "x"
  91.    CDROM FirstDrive$, Drives%
  92.  
  93. -------
  94. FirstDrive$   letter of the first logical drive (init to at least one space!)
  95. Drives%       number of logical drives available (0 if no CD-ROM is there)
  96.  
  97.  
  98. Name  : CheckDate            (Check Date validity)
  99. Class : Time
  100. Level : Any
  101.  
  102. This routine checks a date to see if it is valid.
  103.  
  104.    CheckDate MonthNr%, DayNr%, YearNr%, ErrCode%
  105.  
  106. MonthNr%     month number (1-12)
  107. DayNr%       day number (1-31)
  108. YearNr%      year number (1900 on; years <100 assumed 1900s)
  109. -------
  110. ErrCode%     whether the date is valid (0 yes)
  111.  
  112.  
  113. Name  : CheckShare           (Check for SHARE)
  114. Class : Disk
  115. Level : DOS
  116.  
  117. The CheckShare routine determines whether SHARE.EXE is active.
  118. This is particularly helpful before using the BASIC OPEN
  119. statement, which will fail if you request file sharing when
  120. it's not available.  The PBClone file routines handle such
  121. situations automatically, so CheckShare is not needed for them.
  122.  
  123.    CheckShare ShareActive%
  124.  
  125. -------
  126. ShareActive%   whether SHARE is active (0 if no)
  127.  
  128.  
  129. Name  : CheckShare2%         (Check for SHARE)
  130. Class : Disk
  131. Level : DOS
  132.  
  133. The CheckShare2% function determines whether SHARE.EXE is active.  This is
  134. particularly helpful before using the BASIC OPEN statement, which will fail
  135. if you request file sharing when it's not available.  The PBClone file
  136. routines handle such situations automatically, so CheckShare2% is not needed
  137. for them.
  138.  
  139.    ShareActive% = CheckShare2%
  140.  
  141. -------
  142. ShareActive%   whether SHARE is active (0 if no)
  143.  
  144. Name  : Cipher               (Cipher)
  145. Class : String
  146. Level : Any
  147.  
  148. This is a very simple text encryption routine.  It isn't
  149. particularly hard to crack, but will provide a basic level of
  150. security for undemanding applications.  The same routine can be
  151. used either to encrypt or decrypt text.  The original text may
  152. contain any character; likewise, the resulting text.  This is
  153. not well suited for use with sequential files-- if such is
  154. required, see CipherP.
  155.  
  156. I'd suggest using a long password composed of an unlikely
  157. string of characters, e.g. "#*@@!A^%x{.'".
  158.  
  159.    Cipher St$, Password$
  160.  
  161. St$        string to encrypt or decrypt
  162. Password$  password
  163. -------
  164. St$        encrypted or decrypted string
  165.  
  166.  
  167. Name  : CipherP              (Cipher Printable)
  168. Class : String
  169. Level : Any
  170.  
  171. This is a very simple text encryption routine.  It isn't
  172. particularly hard to crack, but will provide a basic level of
  173. security for undemanding applications.  The same routine can be
  174. used either to encrypt or decrypt text.  The original text may
  175. contain any character below CHR$(128), as may the password.
  176. The resulting text will be printable, if bizarre (all
  177. characters will be above CHR$(127)), and may be used with
  178. sequential files.
  179.  
  180. This routine is potentially less secure than the Cipher routine
  181. (see).
  182.  
  183. I'd suggest using a long password composed of an unlikely
  184. string of characters, e.g. "#*@@!A^%x{.'".
  185.  
  186.    CipherP St$, Password$
  187.  
  188. St$        string to encrypt or decrypt
  189. Password$  password
  190. -------
  191. St$        encrypted or decrypted string
  192.  
  193. Name  : DateA2R              (Date Actual to Relative)
  194. Class : Time
  195. Level : Any
  196.  
  197. This routine converts an actual date to a relative date,
  198. expressed as a number of days.  This allows you to compare
  199. dates, find out what the date will be in a given number of days
  200. (or what it was a given number of days ago), see how many days
  201. passed between two dates, and so forth.
  202.  
  203. I've frequently seen routines of this nature called "Julian
  204. date" routines. I'm not sure where that nomenclature
  205. originated, as it has nothing to do with the Julian calendar.
  206. Most of these routines rely on approximations through floating
  207. point math, and may or may not handle leap years and centuries
  208. appropriately.  The DateA2R routine takes no such shortcuts and
  209. may be relied upon to return accurate results.
  210.  
  211.    DateA2R MonthNr%, DayNr%, YearNr%, RelDate&
  212.  
  213. MonthNr%     month number (1-12)
  214. DayNr%       day number (1-31)
  215. YearNr%      year number (1900 on; years <100 assumed in 1900s)
  216. -------
  217. RelDate&     relative date
  218.  
  219.  
  220. Name  : DateN2S              (Date Numbers to String)
  221. Class : Time
  222. Level : Any / DOS
  223.  
  224. Many of the PBClone routines return the date as a set of
  225. numbers.  This routine provides an easy way to convert those
  226. numbers into string form.  The date format used (year length
  227. and delimiter) will be based on the string which you pass to
  228. the routine.  For instance, "xx-xx-xxxx" will return a date
  229. like "11-26-1990", whereas "xx.xx.xxxx" would return
  230. "11.26.1990", and "xx/xx/xx" would return "11/26/90".
  231.  
  232. If you pass zeroes for the MonthNr%, Day%, and Year% values,
  233. the current date will be returned in the format that you
  234. specified.
  235.  
  236. The ProBas and PBClone versions of this routine do not work the
  237. same way in regards to the year.  ProBas assumed that any
  238. two-digit year was in the 1900s.  In contrast, PBClone assumes
  239. that years 80-99 should be converted to 1980-1999 and that 0-79
  240. should be converted to 2000-2079.
  241.  
  242.    DateSt$ = "xx-xx-xxxx"
  243.    DateN2S MonthNr%, Day%, Year%, DateSt$
  244.  
  245. MonthNr%  month
  246. Day%      day
  247. Year%     year
  248. -------
  249. DateSt$   date string.  Init to 8 or 10 chars (see above).
  250.  
  251.  
  252. Name  : DateR2A              (Date Relative to Actual)
  253. Class : Time
  254. Level : Any
  255.  
  256. This is the opposite of the DateA2R routine-- it takes a
  257. "relative" date and converts it back to the usual form.
  258.  
  259.    DateR2A MonthNr%, DayNr%, YearNr%, RelDate&
  260.  
  261. RelDate&     relative date
  262. -------
  263. MonthNr%     month number (1-12)
  264. DayNr%       day number (1-31)
  265. YearNr%      year number (1900 on)
  266.  
  267.  
  268. Name  : DateS2N              (Date String to Numbers)
  269. Class : Time
  270. Level : Any
  271.  
  272. Many of the PBClone routines need to be passed the date as a
  273. set of numbers. This routine provides an easy way to convert a
  274. date from string form into numbers.  You may use either
  275. "xx/xx/xx" or "xx-xx-xxxx" form to specify the date (the string
  276. length is important, but the delimiter and contents of the
  277. string are ignored).
  278.  
  279. The ProBas and PBClone versions of this routine do not work the
  280. same way in regards to the year.  ProBas assumed that any
  281. two-digit year was in the 1900s.  In contrast, PBClone assumes
  282. that years 80-99 should be converted to 1980-1999 and that 0-79
  283. should be converted to 2000-2079.
  284.  
  285.    DateS2N MonthNr%, Day%, Year%, DateSt$
  286.  
  287. DateSt$   date string.  Init to 8 or 10 characters (see above).
  288. -------
  289. MonthNr%  month
  290. Day%      day
  291. Year%     year
  292.  
  293.  
  294. Name  : DelFile
  295. Class : Disk
  296. Level : DOS
  297.  
  298. This works like the DOS DEL (or ERASE) command, although it does not allow
  299. wildcards.  The specified file is deleted.  Full path specifications are
  300. supported, including drive and subdirectory specs.
  301.  
  302.    DelFile FileName$, ErrCode%
  303.  
  304. FileName$   name of the file to delete
  305. -------
  306. ErrCode%    0 if no error, else DOS Error
  307.  
  308.  
  309. Name  : DriveSpace&
  310. Class : Disk
  311. Level : DOS
  312.  
  313. This routine tells you how many bytes are free on a specified disk drive.
  314.  
  315.    BytesFree& = DriveSpace&(Drive$)
  316.  
  317. Drive$      letter of the drive to examine
  318. -------
  319. BytesFree&  free bytes on the specified drive, or -1 if bad drive or disk error
  320.  
  321.  
  322. Name  : DrvType              (Drive Type)
  323. Class : Disk
  324. Level : DOS 3.1+
  325.  
  326. The DrvType routine tells you whether a specified drive is
  327. fixed or removeable, and whether it is local or remote (network
  328. drive).
  329.  
  330.    DrvType Drive$, Removeable%, Remote%, ErrCode%
  331.  
  332. Drive$       letter of the drive to examine
  333. -------
  334. Removeable%  whether the disk can be removed (0 if no)
  335. Remote%      whether this is a remote drive (0 if no)
  336. ErrCode%     error code: 0 if none, else bad DOS version
  337.  
  338. Name  : Elapsed              (Elapsed time)
  339. Class : Time
  340. Level : Any
  341.  
  342. This routine tells you the amount of time elapsed between a
  343. given starting time and ending time.  The difference between
  344. the times must be less than 24 hours for the results to be
  345. meaningful.
  346.  
  347.    Elapsed TimeStart$, TimeStop$, TimeDiff$
  348.  
  349. TimeStart$   starting time
  350. TimeStop$    ending time
  351. -------
  352. TimeDiff$    elapsed time
  353.  
  354. Name  : EMSBuffer
  355. Class : Memory
  356. Level : BIOS
  357.  
  358. EMSBuffer tells you how many bytes are needed to save the state of the EMS
  359. array routines.  Used in conjunction with EMSSave and EMSRest, it allows you
  360. to preserve EMS arrays across a CHAIN to another part of your program.
  361.  
  362.    EMSBuffer Bytes%
  363.    EMSState$ = SPACE$(Bytes%)
  364.    EMSSave EMSState$
  365.  
  366. -------
  367. Bytes%       bytes needed to save EMS array state
  368.  
  369. Name  : EMSClose
  370. Class : Memory
  371. Level : BIOS
  372.  
  373. The EMSClose routine is used when you are finished with an EMS array.  It
  374. frees the array handle and EMS memory for other uses.  If you don't close all
  375. EMS arrays before your program ends, the memory will be lost until the system
  376. is rebooted, so it is important to remember EMSClose.
  377.  
  378.    EMSClose ArrayHandle%
  379.  
  380. ArrayHandle%    handle of an EMS array
  381.  
  382.  
  383. Name  : EMSGet
  384. Class : Memory
  385. Level : BIOS
  386.  
  387. This routine gets an element from an EMS array created by EMSOpen.  Element
  388. numbers start at 0.  Be sure to use the right numeric type for the array--
  389. for instance, if you opened the array for SINGLE precision, use "Value!".
  390.  
  391.    EMSGet ArrayHandle%, ElementNr&, Value
  392.  
  393. ArrayHandle%    handle of an EMS array
  394. ElementNr&      element number to get
  395. -------
  396. Value           value to get element into (must be correct type for array)
  397.  
  398.  
  399. Name  : EMSOpen
  400. Class : Memory
  401. Level : BIOS
  402.  
  403. This routine allows you to open a block of EMS (expanded) memory which can
  404. then be accessed like a numeric array.  The array size is limited only by
  405. available EMS memory (use GetLIMM to find out how much is available).  You
  406. may specify any numeric type:
  407.  
  408.     1   INTEGER
  409.     2   LONG or SINGLE
  410.     3   DOUBLE
  411.  
  412. When the array is opened, you are returned an "array handle" which is used to
  413. access that array.  Access to the array is done via EMSGet and EMSPut.  When
  414. you are finished with the array, you must close it with EMSClose.
  415.  
  416. As many as 25 EMS arrays can be in use at one time, subject to limitations
  417. which may be imposed by your EMS driver (each array requires one EMS handle).
  418.  
  419.    EMSOpen Elements&, ElementType%, ArrayHandle%, ErrCode%
  420.  
  421. Elements&       number of elements in array (like DIM size)
  422. ElementType%    numeric type of array (see above)
  423. -------
  424. ArrayHandle%    handle of an EMS array
  425. ErrCode%        whether an error occurred (0 no)
  426.  
  427.  
  428. Name  : EMSPut
  429. Class : Memory
  430. Level : BIOS
  431.  
  432. This routine puts an element into an EMS array created by EMSOpen.  Element
  433. numbers start at 0.  Be sure to use the right numeric type for the array--
  434. for instance, if you opened the array for SINGLE precision, use "Value!".
  435.  
  436.    EMSPut ArrayHandle%, ElementNr&, Value
  437.  
  438. ArrayHandle%    handle of an EMS array
  439. ElementNr&      element number to set
  440. Value           value to set element to (must be correct type for array)
  441.  
  442.  
  443. Name  : EMSRest
  444. Class : Memory
  445. Level : BIOS
  446.  
  447. This routine allows you to restore the state of the EMS array handler.  Used
  448. in conjunction with EMSBuffer and EMSSave, it allows you to preserve EMS
  449. arrays across a CHAIN to another part of your program.
  450.  
  451.    EMSRest EMSState$
  452.  
  453. EMSState$    saved EMS array state
  454.  
  455.  
  456. Name  : EMSSave
  457. Class : Memory
  458. Level : BIOS
  459.  
  460. This routine allows you to save the state of the EMS array handler.  Used in
  461. conjunction with EMSBuffer and EMSRest, it allows you to preserve EMS arrays
  462. across a CHAIN to another part of your program.
  463.  
  464.    EMSBuffer Bytes%
  465.    EMSState$ = SPACE$(Bytes%)
  466.    EMSSave EMSState$
  467.  
  468. -------
  469. EMSState$    saved EMS array state
  470.  
  471.  
  472. Name  : EnhKbd
  473. Class : Input
  474. Level : BIOS
  475.  
  476. By default, the PBClone routines assume an old-style keyboard is in use, for
  477. greatest compatibility.  EnhKbd allows you to turn on enhanced keyboard
  478. handling for the current generation of (usually) 101-key keyboards.  This
  479. allows access to the F11 and F12 function keys as well as codes for key
  480. combinations that used to be ignored, among other things.
  481.  
  482. The KbdType or KbdType2% routine can be used to determine if an enhanced
  483. keyboard is available (recommended).
  484.  
  485. Note that EnhKbd works by intercepting the BIOS keyboard handler.  All calls
  486. to the BIOS keyboard interrupt are converted from the old keyboard functions
  487. to the new ones.  YOU MUST DISABLE EnhKbd BEFORE YOUR PROGRAM ENDS, so it can
  488. restore the old setup.  Otherwise, the computer will most probably crash.
  489.  
  490.    EnhKbd Enable%
  491.  
  492. Enable%     turn on enhanced keyboard support (0 disable, else enable)
  493.  
  494.  
  495. Name  : EuropeDate           (European Date format)
  496. Class : Time
  497. Level : Any
  498.  
  499. This routine takes a date in one of the American formats
  500. ("MM/DD/YY" or "MM-DD-YYYY") and converts it to the European
  501. convention ("DD.MM.YY" or "DD.MM.YYYY").  The date is formatted
  502. according to a format string which provides the desired
  503. delimiter and year length, e.g. "##-##-##" specifies a
  504. delimiter of "-" and a year length of two digits.
  505.  
  506. An error code is returned if the date is not valid.
  507.  
  508.    EuropeDate DateSt$, Format$, Result$, ErrCode%
  509.  
  510. DateSt$     date to format (month, day, year order)
  511. Format$     format for the date
  512. -------
  513. Result$     resulting date (day, month, year order)
  514. ErrCode     whether the date is valid (0 ok)
  515.  
  516.  
  517. Name  : FormatDate           (Format Date)
  518. Class : Time
  519. Level : Any
  520.  
  521. This is a highly flexible date formatting routine.  It accepts
  522. a date in one of the usual American formats ("03-22-1990",
  523. "03/22/90", or even "3/22/90") and converts it according to a
  524. format string.  This format string allows you to normalize the
  525. date, select a new delimiter, choose between two-digit and
  526. four-digit years, and even change the order from month/day/year
  527. to anything else.  An error code will be returned if the date
  528. is not valid.
  529.  
  530. The format string can be as simple as "##/##/##", which
  531. specifies that the usual month/day/year order be used, with a
  532. delimiter of "/" and a two-digit year.  If you want to change
  533. the date order, you would need a format like "DD.MM.YYYY"
  534. instead.  For sorting or storage, you might want to convert the
  535. date to a plain number, using a format string like "YYYYMMDD".
  536. The result could then be converted to a LONG with the BASIC VAL
  537. function.
  538.  
  539.    FormatDate DateSt$, Format$, Result$, ErrCode%
  540.  
  541. DateSt$     date to format (month, day, year order)
  542. Format$     format for the date
  543. -------
  544. Result$     resulting date
  545. ErrCode     whether the date is valid (0 ok)
  546.  
  547.  
  548. Name  : Get4DOSv             (Get 4DOS Version)
  549. Class : Equipment
  550. Level : DOS
  551. The Get4DOSv routine returns the version of 4DOS being used.  It returns the
  552. results as two integers containing the major and minor version numbers. For
  553. instance, 4DOS 4.0 would return a major number of 4, minor 0.  If 4DOS is not
  554. installed, both version numbers will be zero.
  555. If you're not familiar with 4DOS, it's a terrific improved replacement for
  556. COMMAND.COM.  For more information, write JP Software Inc., P.O. Box 1470,
  557. Arlington MA 02174, or call your local BBS.
  558.  
  559.    Get4DOSv MajorV%, MinorV%
  560.  
  561. -------
  562. MajorV%   major part of the 4DOS version
  563. MinorV%   minor part of the 4DOS version
  564.  
  565. Name  : GetDOSV                 (Called by DoorFrame - DON'T DELETE!)
  566. Class : Equipment
  567. Level : DOS
  568. The GetDOSV routine tells you what version of DOS you're using.  It returns
  569. the results as two integers containing the major and minor version numbers.
  570. For instance, MS-DOS 2.11 would return a major number of 2, minor 11.
  571.  
  572. The OS/2 compatibility box returns version numbers beginning at 10.00.  For
  573. instance, OS/2 v1.1 returns 10.10 and OS/2 v2.0 returns 20.00.
  574.  
  575.    GetDOSV MajorV%, MinorV%
  576.  
  577. -------
  578. MajorV%   major part of the DOS version
  579. MinorV%   minor part of the DOS version
  580.  
  581. Name  : Getdrv               (Get default Drive)
  582. Class : Disk
  583. Level : DOS
  584.  
  585. This routine tells you the letter of the current default drive.
  586.    Drive$ = "x"
  587.    GetDrv Drive$
  588.  
  589. -------
  590. Drive$    default drive letter.  Init to at least one character.
  591.  
  592. Name  : GetDView
  593. Class : Miscellaneous
  594. Level : DOS
  595.  
  596. The GetDView routine tells you what version of DESQview is loaded.  It
  597. returns the results as two integers containing the major and minor version
  598. numbers.  For instance, DESQview 2.0 would return a major number of 2 and a
  599. minor number of 0.  If DESQview is not loaded, zeroes are returned.
  600. See also GetTView, GetTVScreen, UpdTVScreen.
  601.  
  602.    GetDView MajorV%, MinorV%
  603.  
  604. -------
  605. MajorV%   major part of the DESQview version (0 if DESQview is not loaded)
  606. MinorV%   minor part of the DESQview version
  607.  
  608.  
  609. Name  : GetexecPath          (Get Execution Path of program)
  610. Class : Disk
  611. Level : DOS 3.0+
  612.  
  613. This routine returns the full path of your program, i.e., the
  614. drive, subdirectory, and name of the program.  It does not rely
  615. on the current drive and subdirectory settings or look at the
  616. PATH setting-- DOS tells it directly.  This makes it an
  617. excellent way to find the program's "home" directory, where
  618. (hopefully) any data files associated with the program will
  619. also be stored.
  620.  
  621.    SelfName$ = SPACE$(80)
  622.    GetExecPath SelfName$, SelfLen%
  623.    SelfName$ = LEFT$(SelfName$, SelfLen%)
  624.  
  625. -------
  626. SelfName$   full path for current program.  Init to 80+ chars.
  627. SelfLen%    length of the full path spec.
  628.  
  629.  
  630. Name  : GetKbd
  631. Class : Input
  632. Level : Clone
  633.  
  634. The GetKbd routine allows you to get the state of the four keyboard toggles:
  635. Insert, Caps lock, Num lock, and Scroll Lock.
  636.  
  637.    GetKbd Insert%, Caps%, Num%, Scrl%
  638.  
  639. -------
  640. Insert%    whether "insert" mode is on (0 if no)
  641. Caps%      whether "caps lock" is on (0 if no)
  642. Num%       whether "num lock" is on (0 if no)
  643. Scrl%      whether "scroll lock" is on (0 if no)
  644.  
  645.  
  646. Name  : GetKbd1
  647. Class : Input
  648. Level : Clone
  649.  
  650. The GetKbd1 routine allows you to get the state of the four keyboard shift
  651. keys: Left shift, Right shift, Control and Alt.
  652.  
  653.    GetKbd1 LShift%, RShift%, Control%, Alt%
  654.  
  655. -------
  656. LShift%    whether the left shift key is depressed (0 if no)
  657. RShift%    whether the right shift key is depressed (0 if no)
  658. Control%   whether a control key is depressed (0 if no)
  659. Alt%       whether an alt key is depressed (0 if no)
  660.  
  661.  
  662. Name  : GetKbd2
  663. Class : Input
  664. Level : AT BIOS
  665.  
  666. The GetKbd2 routine allows you to get the state of the six keyboard shift
  667. keys on an "enhanced" keyboard: Left shift, Right shift, Left Control, Right
  668. Control, Left Alt and Right Alt.
  669.  
  670. Normally, the BIOS only lets you see one key at a time, which can be a
  671. barrier when you need more input.  This is a particular problem with action
  672. games and other real-time applications which have complex input requirements.
  673. Due to the special way the BIOS treats shift keys, GetKbd2 can tell if the
  674. the various shift keys are pressed simultaneously, allowing more flexibility.
  675.  
  676.    GetKbd2 LShift%, RShift%, LCtrl%, RCtrl%, LAlt%, RAlt%
  677.  
  678. -------
  679. LShift%    whether the left shift key is depressed (0 if no)
  680. RShift%    whether the right shift key is depressed (0 if no)
  681. LCtrl%     whether the left control key is depressed (0 if no)
  682. RCtrl%     whether the right control key is depressed (0 if no)
  683. LAlt%      whether the left alt key is depressed (0 if no)
  684. RAlt%      whether the right alt key is depressed (0 if no)
  685.  
  686. Name  : GetLIMHandles
  687. Class : Memory
  688. Level : DOS
  689.  
  690. Early Lotus/Intel/Microsoft expanded memory revisions provided a limited
  691. number of "handles" which could be used to access expanded memory-- often as
  692. few as 15 or so.  If your program uses expanded memory and the EMS driver is
  693. one of the older versions, you may want to make sure that enough handles are
  694. available.  This routine tells you how many handles are in use.
  695.  
  696. Note that this routine expects an EMS driver to be installed.  If you can't
  697. be sure of that, use GetLIMM first to avoid an unpleasant surprise.
  698.  
  699.    GetLIMHandles Handles%
  700.  
  701. -------
  702. Handles%  number of EMS handles in use
  703.  
  704. Name  : GetLIMM
  705. Class : Memory / Equipment
  706. Level : DOS
  707.  
  708. This routine tells you how much expanded memory is installed.  If there is
  709. none, or if the EMS driver hasn't been installed, it returns zeroes.  You
  710. should use this routine before any other of the PBClone routines that access
  711. expanded memory, since the other routines expect EMS to be available.
  712.  
  713. The results are returned in terms of EMS pages.  Each page is 16 kilobytes.
  714.  
  715.    GetLIMM TotalPages%, FreePages%
  716.  
  717. -------
  718. TotalPages%  number of EMS pages installed
  719. FreePages%   number of EMS pages available for use
  720.  
  721.  
  722. Name  : GetLIMV
  723. Class : Memory / Equipment
  724. Level : DOS
  725.  
  726. The GetLIMV routine tells you the version of EMS driver that is being used.
  727. The version number is separated into major and minor parts.  For example, an
  728. EMS 3.1 driver would return a major number of 3 and minor number of 1.
  729.  
  730. Note that this routine expects an EMS driver to be installed.  If you can't
  731. be sure of that, use GetLIMM first to avoid an unpleasant surprise.
  732.  
  733.    GetLIMV MajorVer%, MinorVer%
  734.  
  735. -------
  736. MajorVer%  major part of the EMS version number
  737. MinorVer%  minor part of the EMS version number
  738.  
  739. Name  : GetTView             (Get TopView)
  740. Class : Miscellaneous
  741. Level : BIOS
  742.  
  743. This routine tells you whether TopView or a compatible multitasker (such as
  744. TaskView or DESQview) is loaded.
  745. See also GetDView, GetTVScreen, UpdTVScreen.
  746.  
  747.    GetTView Installed%
  748.  
  749. -------
  750. Installed%   whether a TopView-type multitasker is loaded (0 no)
  751.  
  752. Name  : GetTVScreen          (Get TopView Screen address)
  753. Class : Display / Miscellaneous
  754. Level : BIOS
  755.  
  756. GetTVScreen returns the address of the screen buffer used by a TopView-type
  757. multitasker.  This allows you to use direct screen access while remaining
  758. within the windows allocated to your program by the multitasker.
  759.  
  760. You must tell the multitasker the address of the screen you would be writing
  761. to if the multitasker was not installed.  Specify a segment of &HB000 if
  762. using an MDA or Hercules, or a segment of &HB800 for CGA, EGA, MCGA or VGA.
  763. The offset should always be 0.  This is for use in text modes.
  764.  
  765. The routine will return with the new segment and offset for you to use.
  766. These values can be used with any PBClone screen routine that accepts a
  767. segment and offset-- DQPrint and DXQPrint, for example.
  768.  
  769. Note that not all TopView-compatible multitaskers will automatically update
  770. the screen from the buffer.  The UpdTVScreen routine allows you to force a
  771. screen update.
  772. See also GetDView, GetTView, UpdTVScreen.
  773.  
  774.    GetTVScreen DSeg%, DOfs%
  775.  
  776. DSeg%       segment of desired screen
  777. DOfs%       offset of desired screen
  778. -------
  779. DSeg%       segment of screen buffer
  780. DOfs%       offset of screen buffer
  781.  
  782.  
  783. Name  : KbdType
  784. Class : Input / Equipment
  785. Level : Clone
  786.  
  787. This routine tells you if an enhanced (101-key) keyboard is available.
  788.  
  789. KbdType differs from the ProBas routine of the same name in that it has
  790. additional error checking.  If it is not entirely sure that an enhanced
  791. keyboard is available, it plays safe and assumes there isn't one.  This
  792. avoids possible disaster on older PCs.
  793.  
  794.    KbdType Enhanced%
  795.  
  796. -------
  797. Enhanced%    whether keyboard is of the enhanced type (0 no)
  798.  
  799.  
  800. Name  : LClose
  801. Class : Memory
  802. Level : BIOS
  803.  
  804. This routine closes a block of expanded memory that was opened for access by
  805. LOpen.  It is important to close the block when you are finished with it, to
  806. return it to the free memory pool.
  807.  
  808. Routines in this suite include: LOpen, LGet, LPut, LClose.
  809.  
  810.    LClose EMSHandle%
  811.  
  812. EMSHandle%    handle of the expanded memory block
  813.  
  814.  
  815. Name  : LGet
  816. Class : Memory
  817. Level : BIOS
  818.  
  819. This routine gets a block of data from expanded memory that was opened for
  820. access by LOpen.  The amount of data is specified in words; one word is the
  821. same as two bytes.  An integer takes up a word, long integers and single
  822. precision numbers require two words, and double precision numbers take four.
  823.  
  824. Routines in this suite include: LOpen, LGet, LPut, LClose.
  825.  
  826.    LGet EMSHandle%, DSeg%, DOfs%, Words%
  827.  
  828. EMSHandle%    handle of the expanded memory block
  829. DSeg%         segment of place to store data
  830. DOfs%         offset of place to store data
  831. Words%        words to get from expanded memory
  832.  
  833.  
  834. Name  : LOpen
  835. Class : Memory
  836. Level : BIOS
  837.  
  838. This routine opens a block of expanded memory for access.  The size of the
  839. block is specified in words; one word is the same as two bytes.  An integer
  840. takes up a word, long integers and single precision numbers require two
  841. words, and double precision numbers take four.  This allows you to store up
  842. to 64K in each EMS block that you open.
  843.  
  844. Note that LOpen expects an EMS driver to be available.  If you are not
  845. certain on this point, use GetLIMM beforehand to make sure.
  846.  
  847. Routines in this suite include: LOpen, LGet, LPut, LClose.
  848.  
  849.    LOpen Words%, EMSHandle%, ErrCode%
  850.  
  851. Words%        size of expanded memory block to allocate
  852. -------
  853. EMSHandle%    handle of the expanded memory block
  854. ErrCode%      error code (0 if no error)
  855.  
  856. Name  : LPut
  857. Class : Memory
  858. Level : BIOS
  859.  
  860. This routine puts a block of data into expanded memory that was opened for
  861. access by LOpen.  The amount of data is specified in words; one word is the
  862. same as two bytes.  An integer takes up a word, long integers and single
  863. precision numbers require two words, and double precision numbers take four.
  864.  
  865. Routines in this suite include: LOpen, LGet, LPut, LClose.
  866.  
  867.    LPut EMSHandle%, DSeg%, DOfs%, Words%
  868.  
  869. EMSHandle%    handle of the expanded memory block
  870. DSeg%         segment of place from which to get data
  871. DOfs%         offset of place from which to get data
  872. Words%        words to put into expanded memory
  873.  
  874. Name  : LRotate
  875. Class : String
  876. Level : Any
  877.  
  878. Many years ago, I wrote one of the first terminal programs for the PC.  It
  879. died a horrible death when Qmodem came out... sigh.  This routine comes from
  880. that experience.  It rotates the characters in a string left once (e.g.,
  881. "ABCDE" becomes "BCDEA").  I used this in my routine to dial a list of BBSes,
  882. skipping to the next one if the current one was busy.
  883.  
  884. LRotate can also be handy for things like scrolling a long message across the
  885. screen (you just PRINT LEFT$(Message$, 80); then delay a bit, LRotate and do
  886. it again).
  887.  
  888.    LRotate St$
  889.  
  890. St$     string to be rotated left once
  891. -------
  892. St$     string after being rotated left once
  893.  
  894.  
  895. Name  : NameCase                (Called by DoorFrame - DON'T DELETE!)
  896. Class : String
  897. Level : Any
  898.  
  899. This routine provides a specialized uppercase/lowercase converter designed
  900. especially for names.  It converts the first letter in each word in a string
  901. to uppercase, with the rest of the word being converted to lowercase.
  902.  
  903. See also NameCase2, the FUNCTION version of this routine.
  904.  
  905.    NameCase St$
  906.  
  907. St$         string to process
  908. -------
  909. St$         processed string
  910.  
  911.  
  912. Name  : NameCase2$           (Name Case)
  913. Class : String
  914. Level : Any
  915.  
  916. This routine provides a specialized uppercase/lowercase
  917. converter designed especially for names.  It converts the first
  918. letter in each word in a string to uppercase, with the rest of
  919. the word being converted to lowercase.
  920.  
  921. See also NameCase, the SUB version of this routine.
  922.  
  923.    Result$ = NameCase2$(St$)
  924.  
  925. St$         string to process
  926. -------
  927. Result$     processed string
  928.  
  929.  
  930. Name  : Processor
  931. Class : Equipment
  932. Level : Any
  933.  
  934. Processor returns the type of processor (CPU) installed.
  935.  
  936. Results are returned as follows:
  937.  
  938.    0    NEC V20
  939.    1    8088 or 8086
  940.    2    80186
  941.    3    80286
  942.    4    80386 or 80486
  943.  
  944.    Processor ProcType%
  945.  
  946. -------
  947. ProcType%    type of CPU (see above)
  948.  
  949.  
  950. Name  : Retries
  951. Class : Disk
  952. Level : DOS 3.1+
  953. This routine allows you to adjust the handling of file-sharing errors.  When
  954. such an error occurs, DOS normally retries 3 times, with a wait of 1 between
  955. tries.  This allows temporary conditions, such as someone else using the file
  956. you want to access, to clear up.  In many cases, though, you may want to
  957. change this delay.  A shorter delay will improve response time, allowing your
  958. program to handle the error more quickly.  A longer delay may be more suited
  959. for a busy network, allowing the request to proceed after a reasonable
  960. waiting period.
  961.  
  962. The delay period between each retry is unfortunately machine-dependent, i.e.,
  963. you will need larger delays on faster machines to achieve the same effect.
  964. This can only be considered a flaw in DOS.
  965.  
  966. Note that shorter waiting periods will improve response time for your
  967. program, but may adversely affect the network.  Normally, you should use the
  968. longest waiting period with which you feel comfortable.
  969.  
  970.    Retries Times%, WaitTime%
  971.  
  972. Times%     number of times to retry if a file-sharing violation occurs
  973. WaitTime%  amount of time to delay between retries
  974.  
  975. Name  : Reverse              (Reverse)
  976. Class : String
  977. Level : Any
  978. This little fellow reverses the order of the characters in a
  979. string.  It is one of the vital components of RInstr, but other
  980. than that I see no real use for it.  On the other hand, George
  981. Boole thought that Boolean logic was of solely theoretical
  982. interest, and yet without it there would be no computers. I
  983. leave it to you to find the earth-shattering possibilities of
  984. Reverse!
  985.  
  986.    Reverse St$
  987.  
  988. St$      string to be reversed
  989. -------
  990. St$      reversed string
  991.  
  992. Name  : RInstr               (Reverse INSTR)
  993. Class : String
  994. Level : Any
  995. Like INSTR, this routine tells you the position of a substring
  996. within a string.  A "reverse" search is used, however-- whereas
  997. INSTR tells you the first match, RInstr tells you the last
  998. match.  Similarly, whereas INSTR will tell you that a null
  999. search string matches the main string at the first position,
  1000. RInstr will match on the last position.  Of course, most of the
  1001. time you won't be searching for a null string!
  1002.  
  1003.    RInstr MainSt$, SeekSt$, Posn%
  1004.  
  1005. MainSt$    string to search
  1006. SeekSt$    string for which to search
  1007. -------
  1008. Posn%      position of substring within main string (0 no match)
  1009.  
  1010.  
  1011. Name  : Sec2Time$            (Seconds to Time)
  1012. Class : Time
  1013. Level : Any
  1014.  
  1015. This routine converts the number of seconds past midnight into
  1016. a time string.
  1017.  
  1018.    TimeSt$ = Sec2Time$(Seconds&)
  1019.  
  1020. Seconds&   number of seconds past midnight
  1021. -------
  1022. TimeSt$    time string (TIME$ format)
  1023.  
  1024. Name  : SetError
  1025. Class : Miscellaneous
  1026. Level : DOS
  1027. The SetError routine allows you to set the "error level" to be returned by
  1028. DOS when your program ends.  This is particularly handy for returning
  1029. information to batch files.
  1030. Note that SetError is best used just before your program ENDs, to avoid
  1031. complications.
  1032.  
  1033.    SetError ErrorLevel%
  1034.  
  1035. ErrorLevel%   exit code to be returned by your program
  1036.  
  1037. Name  : SetKbd
  1038. Class : Input
  1039. Level : Clone
  1040. The SetKbd routine allows you to set the state of any of the four keyboard
  1041. toggles: Insert, Caps lock, Num lock, and Scroll Lock.  You can give your
  1042. input routines a professional touch by setting this toggles instead of making
  1043. the user remember to do so.
  1044.  
  1045. It's considered proper to restore the original keyboard toggles before your
  1046. program exits, unless of course the purpose of the program is to leave the
  1047. toggles in a particular state!  The GetKbd routine can be used in conjunction
  1048. with SetKbd to do this.
  1049.  
  1050.    SetKbd Insert%, Caps%, Num%, Scrl%
  1051.  
  1052. Insert%    whether to turn on "insert" mode (0 if no)
  1053. Caps%      whether to turn on "caps lock" (0 if no)
  1054. Num%       whether to put the keypad into numeric mode (0 if no)
  1055. Scrl%      whether to turn on "scroll lock" (0 if no)
  1056.  
  1057. Name  : Time2Sec&            (Time to Seconds)
  1058. Class : Time
  1059. Level : Any
  1060. This routine converts a time string into the number of seconds
  1061. past midnight. This is convenient if you want to find the
  1062. difference between two times or to calculate what time it will
  1063. be after a given interval.
  1064.  
  1065.    Seconds& = Time2Sec&(TimeSt$)
  1066.  
  1067. TimeSt$    time string (TIME$ format)
  1068. -------
  1069. Seconds&   number of seconds past midnight
  1070.  
  1071.  
  1072. Name  : TInstr               (Typed INSTR)
  1073. Class : String
  1074. Level : Any
  1075. As you might guess from the "Instr" part of the name, this
  1076. routine searches a string.  Instead of searching for a specific
  1077. character or substring, though, it looks for a specific type of
  1078. character-- letters, numbers, control codes, or whatever.  You
  1079. can search for the first of a combination of types, too, which
  1080. also allows searching for "anything but" a specific type.
  1081.  
  1082. The character type code is specified by adding any of the
  1083. following:
  1084.  
  1085.     1    alphabetic
  1086.     2    numeric
  1087.     4    symbolic
  1088.     8    control
  1089.    16    graphics
  1090.    32    space
  1091. The TInstr routine is handy for parsing and cleaning up user
  1092. input, among other uses.
  1093.  
  1094.    TInstr St$, ChrType%, Place%
  1095.  
  1096. St$          string to search
  1097. ChrType%     type of character(s) to search for
  1098. -------
  1099. Place%       position of first char of desired type, or 0
  1100.  
  1101. Name  : UnCalcAttr           (Undo Calculated Attribute)
  1102. Class : Display
  1103. Level : Any
  1104.  
  1105. Many of the display routines in this library require an
  1106. "attribute" rather than foreground and background colors.  An
  1107. attribute is a combination of the foreground and background
  1108. colors in a format which is used by all types of displays when
  1109. in text mode.  The UnCalcAttr routine allows you to decode the
  1110. original colors given the attribute.
  1111.  
  1112. Foreground colors are usually specified as 0-31, with
  1113. backgrounds as 0-7.
  1114.  
  1115.    UnCalcAttr Foreground%, Background%, Attr%
  1116.  
  1117. Attr%         color "attribute"
  1118. -------
  1119. Foreground%   foreground color
  1120. Background%   background color
  1121.  
  1122.  
  1123. Name  : UpdTVScreen          (Update TopView Screen)
  1124. Class : Display
  1125. Level : BIOS
  1126. UpdTVScreen tells a TopView-compatible multitasker to update the screen using
  1127. a specified screen buffer (use GetTVScreen to get the buffer location).  Some
  1128. multitaskers will do this automatically, but some won't.  It's safe to use
  1129. this routine either way.
  1130.  
  1131. See also GetDView, GetTView, GetTVScreen.
  1132.  
  1133.    UpdTVScreen DSeg%, DOfs%
  1134.  
  1135. DSeg%       segment of screen buffer
  1136. DOfs%       offset of screen buffer
  1137.  
  1138. Name  : WinCheck             (Windows Check)
  1139. Class : Equipment
  1140. Level : BIOS
  1141. The WinCheck routine tells you what version of Microsoft Windows is in use,
  1142. if any.  It returns the results as two integers containing the major and
  1143. minor version numbers.  For instance, Windows 3.0 would return a major number
  1144. of 3, minor 0.  Windows/386 v2.x will be identified as 2.0.  If Windows is
  1145. not running, 0.0 will be returned.  NOTE that this routine is not able to
  1146. detect Windows 1.x versions!
  1147.  
  1148.    WinCheck MajorV%, MinorV%
  1149.  
  1150. -------
  1151. MajorV%   major part of the Windows version
  1152. MinorV%   minor part of the Windows version
  1153.  
  1154.  
  1155.